This class is used for creating or updating archives.
The class contains thirteen variables and one function. Click on a
variable or function below to view its information. |
|
Variables |
|
Archive
|
This string value contains the full path to
the archive that you want to create or update. Note that the
archive extension decides what format will be used. If the
file extension is .zip a Zip archive will be created. If the
extension is .sqx a SQX archive will be created and so on. |
|
|
Type
|
This value contains information on what archive
format to use. It is a string value and should contain the
format of the archive type to use, for example: "ZIP"
or "7Z". All values that can be found in the format
combo box in the create archive window can be used. |
|
|
Compression
|
This integer value holds the compression
level used when compressing the archive.
Compression Level Chart (0 - lowest, 4
- maximum)
Level/Format |
0 |
1 |
2 |
3 |
4 |
7Z |
X |
X |
X |
X |
X |
CAB |
X |
X |
X |
|
|
LZH |
X |
X |
X |
X |
X |
SQX |
X |
X |
X |
X |
|
TAR |
|
|
|
|
|
TBZ |
X |
X |
X |
X |
X |
TGZ |
X |
X |
X |
X |
X |
YZ1 |
|
|
|
|
|
ZIP |
X |
X |
X |
X |
|
X = supported. |
|
|
WorkingDir
|
This string value contains the full path to
the working directory. The working directory is the directory
that is used as the base directory. If you, for example, want
to add the file: C:\Autoexec.bat to your archive, C:\ would
be added as WorkingDir and Autoexec.bat would be added to
the Data variable. |
|
|
Data
|
This string variable contains all the files
that you want to add to your archive. All files are separated
with a "," (comma). For example if you have two
files to add, Autoexec.bat and Config.sys the Data variable
should be set like this: Data = "Autoexec.bat,Config.sys"; |
|
|
Password
|
This string value contains the password that
you want to use if you want to use encryption on your archive.
Set this variable to "" if you do not want to use
any password encryption. |
|
|
DateExtension
|
0 = no date extension
1 = add a date extension to your archive name |
|
|
TimeExtension
|
0 = no time extension
1 = add a time extension to your archive name |
|
|
Overwrite
|
0 = do not overwrite existing files
1 = overwrite existing files |
|
|
Recurse
|
0 = do not allow recursive file scanning
1 = allow recursive file scanning |
|
|
StoreFolderNames
|
0 = do not store the folder structure or save
the folder names
1 = store the folder structure and save the folder names |
|
|
IncludeHiddenFiles
|
0 = do not include hidden files
1 = include hidden files |
|
|
FileList
|
An optional string variable that contains the
full path to a TXT file which contains a list of all files
and directories to add to the archive. |
|
|
Functions |
|
DoCompress
|
This is the only function in this class and
it will start the compression. First, set the class variables,
then execute this function to begin the process. |
|
|
Example: |
function
main()
{
var Comp =
new Compress();
Comp.Archive = "C:\\My_backup.zip";
Comp.Type = "ZIP";
Comp.Compression = 3;
Comp.WorkingDir = "C:\\";
Comp.Data = "file.txt,file2.txt,file3.txt";
Comp.Password = "";
Comp.DateExtension = 0;
Comp.TimeExtension = 0;
Comp.Overwrite = 1;
Comp.Recurse = 0;
Comp.StoreFolderNames = 1;
Comp.IncludeHiddenFiles = 1;
Comp.DoCompress();
}
|
|